const KoaRouter = require('@koa/router')
const userController = require('../controller/user.controller')
const { verifyUser, handlePassword } = require('../middleware/user.middleware')

const userRouter = new KoaRouter({ prefix: '/users' })

// 2.1 用户注册接口
userRouter.post('/',verifyUser,handlePassword,userController.create)

// 2.2 为用户提供头像展示
userRouter.get('/avatar/:userId', userController.showAvatarImage)

module.exports = userRouter